package com.ktjiaoyu.crm;
import org.junit.Before;
import org.junit.Test;
import org.springframework.boot.test.context.SpringBootTest;
import redis.clients.jedis.Jedis;
@SpringBootTest
public class JedisTester {
    private Jedis jedis;
    @Before
    public void setup(){
     jedis=new Jedis("127.0.0.1",6379);
     jedis.auth("123456");
    }
    @Test
    public void testString() {
        //添加数据
        jedis.set("name", "ktjiaoyu");
        System.out.println(jedis.get("name"));
        jedis.append("name", "czkt");
        System.out.println(jedis.get("name"));
        jedis.del("name");
        System.out.println(jedis.get("name"));
        jedis.mset("name", "ktjiaoyu", "age", "17", "add", "cz");
        jedis.incr("age");
        System.out.println(jedis.get("name") + "-" + jedis.get("age") + "-" + jedis.get("add"));
    }
}
